<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  <div class="box0"></div>
  <div class="box1">
    <b>文字</b>
  </div>
  <div class="box2">
    <em>文字</em>
  </div>
  <input type="text" value="输入框" class="txt">
</body>
<script>

  var box0 = document.querySelector(".box0")
  var box1 = document.querySelector(".box1")
  var box2 = document.querySelector(".box2")
  var txt = document.querySelector(".txt")

  // 查
  console.log( box0.innerHTML );
  console.log( box1.innerHTML );
  console.log( box2.innerText );
  console.log( txt.value );

  // 改
  box1.innerHTML = "<mark>新文字</mark>";
  box2.innerText = "<mark>新文字</mark>";
  txt.value = "<i>哈哈</i>";

  // 增
  box0.innerHTML = "值";
  // 改
  box0.innerHTML = "新值";
  // 删
  box0.innerHTML = "";



  
</script>
</html>